<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>手风琴案例</title>
</head>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .nav {
            width: 900px;
            height: 60px;
            background-color: #FF9999;
            margin: 0 auto;
        }
        .nav li {
            width: 100px;
            height: 60px;
            float: left;
            position: relative;
            overflow: hidden;
        }
        .nav span {
            position: absolute;
            width: 100%;
            height: 100%;
            background-color: #FF3300;
        }
        .nav a {
            position: absolute;
            width: 100%;
            height: 100%;
            font-size: 24ps;
            color: #FF3399;
            text-align: center;
            line-height: 60px;
            text-decoration: none;
            z-index: 2;
        }
    </style>
<body>
    
    <div class="nav">
        <ul>
            <li><a href="#">导航1</a> <span style="top: 60px;"></span></li>
            <li> <a href="#">导航2</a><span style="top: 60px;"></span></li>
            <li> <a href="#">导航3</a><span style="top: 60px;"></span></li>
            <li> <a href="#">导航4</a><span style="top: 60px;"></span></li>
            <li><a href="#">导航5</a><span style="top: 60px;"></span></li>
            <li><a href="#">导航6</a><span style="top: 60px;"></span></li>
            <li><a href="#">导航7</a><span style="top: 60px;"></span></li>
            <li><a href="#">导航8</a><span style="top: 60px;"></span></li>
            <li><a href="#">导航9</a> <span style="top: 60px;"></span></li>
        </ul>
        <div>
            <audio src="music/01.wav" ></audio>
            <audio src="music/02.wav" ></audio>
            <audio src="music/03.wav" ></audio>
            <audio src="music/01.wav" ></audio>
            <audio src="music/02.wav" ></audio>
            <audio src="music/03.wav" ></audio>
            <audio src="music/01.wav" ></audio>
            <audio src="music/02.wav" ></audio>
            <audio src="music/03.wav" ></audio>
        </div>
    </div>

    <script src="../jquery-3.2.1.js"></script>
    <script>
        
        $(function(){
           $(".nav li").mouseenter(function(){
                $(this).children("span").stop().animate({top:0})
                var idx =  $(this).index();
                // 对应音乐播放
                $("audio").get(idx).play();                    
                $("audio").get(idx).play();    // jq没有对音频对象封装 所有用get 不用eq()
           }).mouseleave(function(){
                $(this).children("span").stop().animate({top:60})
           })
        });
    
    </script>
</body>
</html>